#include <math.h>

#include <iostream>
#include <vector>
using namespace std;

int main() {
  int n;
  cin >> n;
  int m = pow(2, n);
  auto matrix = vector(m, vector(m, 1));

  auto pardon = [&](auto &self, int x, int y, int size) {
    if (size == 1) return;
    int half = size / 2;
    for (int i = x; i < x + half; i++) {
      for (int j = y; j < y + half; j++) {
        matrix[i][j] = 0;
      }
    }
    self(self, x, y + half, half);
    self(self, x + half, y, half);
    self(self, x + half, y + half, half);
  };

  pardon(pardon, 0, 0, m);
  for (auto &line : matrix) {
    for (auto &x : line) {
      cout << x << ' ';
    }
    cout << endl;
  }
}